﻿<?php
$grupo_id = $session->read('Auth.User.group_id');
?><div align="center">
					<table width="100%" cellspacing="0" cellpadding="0" border="0">
						<tbody><tr>
							<td>
								<table width="100%" cellspacing="0" cellpadding="0" border="0">
									<tbody><tr>
										<td width="0%" background="/img/default/main_bar_bg.gif"><div align="left"><img width="2" height="30" src="/img/default/main_bar_left.gif"></div></td>
										<td width="100%" background="/img/default/main_bar_bg.gif">
											<table cellspacing="0" cellpadding="0" border="0" align="left">
												<tbody><tr>
													<td><img width="12" height="5" src="/img/default/spacer.gif"></td>
													<td><img width="10" height="10" src="/img/default/dotted_bullet.gif"></td>
													<td><img width="6" height="5" src="/img/default/spacer.gif"></td>
													<td><span class="style8"><?php __('Registro de nova Empresa') ?></span></td>
												</tr>
											</tbody></table>
										</td>
										<td width="0%" background="/img/default/main_bar_bg.gif"><div align="right"><img width="2" height="30" src="/img/default/main_bar_right.gif"></div></td>
									</tr>
								</tbody></table>
							</td>
						</tr>
						<tr>
							<td><table width="100%" cellspacing="0" cellpadding="3" border="0">
</table>

							 <table width="100%" height="550" cellspacing="1" cellpadding="15" border="0" bgcolor="#E2E2E2">
									<tbody><tr><?php echo $this->Form->create('Empresa', array('type' => 'file'));?><input type="hidden" value="new" name="action">
									
										<td valign="top" bgcolor="#FFFFFF">
											<table width="100%" cellspacing="0" cellpadding="17" border="0" bgcolor="#dadbdc">
												<tbody><tr>
													<td bgcolor="#FFFFFF">
														<table width="100%" cellspacing="0" cellpadding="0" border="0">
															<tbody><tr>
																<td>
																	<table width="100%" height="25" cellspacing="0" cellpadding="0" border="0">
																		<tbody><tr>
																			<td bgcolor="#f7f7f7"><span class="style33">&nbsp;&nbsp;Detalhes pessoais</span></td>
																		</tr>
																	</tbody></table>
																</td>
															</tr>
															<tr>
																<td><img width="5" height="5" src="/img/default/spacer.gif"></td>
															</tr>
															<tr>
																<td>
																	<table width="100%" cellspacing="0" cellpadding="3" border="0">
																		<tbody><tr>
																			<td><img width="50" height="5" src="/img/default/spacer.gif"></td>
																			<td><div align="right" class="style27">Nome :</div></td>
																			<td><img width="10" height="5" src="/img/default/spacer.gif"></td>
																			<td>
																			<?php 
																				if(isset($grupo_id))echo $entidade['Entidade']['name'];
																				else {
																			echo $this->Form->input('Empresa.Entidade.name',array('label'=>false,'div'=>false,'size'=>30));?>&nbsp;<span class="inputRequirement">*</span><?php }?></td>
																		</tr>
																		<?php if(!isset($grupo_id)){?>
																		<tr>
																			<td colspan="4">
																				<table width="100%" height="25" cellspacing="0" cellpadding="0" border="0">
																					<tbody><tr>
																						<td bgcolor="#f7f7f7"><span class="style33">&nbsp;&nbsp;Detalhes da Conta</span></td>
																					</tr>
																				</tbody></table>
																			</td>
																		</tr>
																		<tr>
																			<td>&nbsp;</td>
																			<td><div align="right" class="style27">E-Mail Address :</div></td>
																			<td>&nbsp;</td>
																			<td><input type="text" maxlength="50" size="50" name="TREF_email_address">&nbsp;<span class="inputRequirement">*</span></td>
																		</tr>
																		<tr>
																			<td>&nbsp;</td>
																			<td><div align="right" class="style27">Confirm E-Mail Address :</div></td>
																			<td>&nbsp;</td>
																			<td><input type="text" maxlength="50" size="50" name="TREF_confirm_email_address">&nbsp;<span class="inputRequirement">*</span></td>
																		</tr>
																		<tr>
 																	<td>&nbsp;</td>
																		<td><div align="right" class="style27">Password :</div></td>
																		<td>&nbsp;</td>
																		<td><input type="password" name="TR_password">&nbsp;<span class="inputRequirement">*</span></td>
																		</tr>
																		<tr>
																		<td>&nbsp;</td>
																		<td><div align="right" class="style27">Confirm Password :</div></td>
																		<td>&nbsp;</td>
																		<td><input type="password" name="TR_confirm_password">&nbsp;<span class="inputRequirement">*</span></td>
																	</tr>
																	<?php }?>
																		<tr>
																			<td colspan="4">
																				<table width="100%" height="25" cellspacing="0" cellpadding="0" border="0">
																					<tbody><tr>
																						<td bgcolor="#f7f7f7"><span class="style33">&nbsp;&nbsp;Informações da Empresa</span></td>
																					</tr>
																				</tbody></table>
																			</td>
																		</tr>
																		<tr>
																			<td>&nbsp;</td>
																			<?php /*@Todo Os cargos deverao vir da Base de Dados posteriormente*/?>
																			<td><div align="right" class="style27">Seu Cargo na empresa:</div></td>
																			<td>&nbsp;</td>
																			<td><?php echo $this->Form->input('Empresa.Cargo.name',array('label'=>false,'div'=>false,'size'=>50,'id'=>'cargos'));?>&nbsp;<span class="inputRequirement">*</span></td>
																		</tr>
																		<tr>
																			<td>&nbsp;</td>
																			<td><div align="right" class="style27">Nome da empresa :</div></td>
																			<td>&nbsp;</td>
																			<td><?php echo $this->Form->input('Empresa.name',array('label'=>false,'div'=>false,'size'=>50));?>&nbsp;<span class="inputRequirement">*</span></td>
																		</tr>
																		<tr>
																			<td>&nbsp;</td>
																			<td><div align="right" class="style27">Data da fundação :</div></td>
																			<td>&nbsp;</td>
																			<td><?php echo $this->Form->input('Empresa.data_fundacao',array('label'=>false,'div'=>false));?>&nbsp;<span class="inputRequirement">*</span></td>
																		</tr>
																		<tr>
																			<td>&nbsp;</td>
																			<td><div align="right" class="style27">Email da empresa:</div></td>
																			<td>&nbsp;</td>
																			<td><?php echo $this->Form->input('Empresa.email',array('label'=>false,'div'=>false,'size'=>50));?>&nbsp;<span class="inputRequirement">*</span></td>
																		</tr>																		
																		<tr>
																			<td>&nbsp;</td>
																			<td><div align="right" class="style27">Endereço principal:</div></td>
																			<td>&nbsp;</td>
																			<td><?php echo $this->Form->input('Empresa.endereco_principal',array('label'=>false,'div'=>false,'size'=>50));?>&nbsp;<span class="inputRequirement">*</span></td>
																		</tr>
																		<tr>
																			<td>&nbsp;</td>
																			<td><div align="right" class="style27">Província:</div></td>
																			<td>&nbsp;</td>
																			<td><?php echo $this->Form->input('Empresa.provincia_id',array('label'=>false,'div'=>false));?> <span class="inputRequirement">*</span>
																			</td>
																		</tr>																		
																		<tr>
																			<td>&nbsp;</td>
																			<td><div align="right" class="style27">Distrito/Cidade:</div></td>
																			<td>&nbsp;</td>
																			<td><?php echo $this->Form->input('Empresa.distrito_id',array('label'=>false,'div'=>false));?></td>
																		</tr>
																		<tr>
																				<td>&nbsp;</td>
																				<td><div align="right" class="style27">Caixa Postal :</div></td>
																				<td>&nbsp;</td>
																				<td><?php echo $this->Form->input('Empresa.caixa_postal',array('label'=>false,'div'=>false,'size'=>50));?>&nbsp;<span class="inputRequirement">*</span></td>
																		</tr>
																		<tr>
																				<td>&nbsp;</td>
																				<td><div align="right" class="style27">Telefone Principal:</div></td>
																				<td>&nbsp;</td>
																				<td><?php echo $this->Form->input('Empresa.telefone',array('label'=>false,'div'=>false,'size'=>50));?>&nbsp;<span class="inputRequirement">*</span></td>
																		</tr>
																		<tr>
																				<td>&nbsp;</td>
																				<td><div align="right" class="style27">Telefone Principal:</div></td>
																				<td>&nbsp;</td>
																				<td><?php echo $this->Form->input('Empresa.telemovel',array('label'=>false,'div'=>false,'size'=>50));?>&nbsp;<span class="inputRequirement">*</span></td>
																		</tr>																		
																		<tr>
																				<td>&nbsp;</td>
																				<td><div align="right" class="style27">Fax :</div></td>
																				<td>&nbsp;</td>
																				<td><?php echo $this->Form->input('Empresa.fax',array('label'=>false,'div'=>false,'size'=>50));?></td>
																		</tr>
																		<tr>
																				<td>&nbsp;</td>
																				<td><div align="right" class="style27">Logo : </div></td>
																				<td>&nbsp;</td>
																				<td><?php echo $this->Form->input('Empresa.logo',array('type'=>'file','label'=>false,'div'=>false));?> <span class="inputRequirement">*</span></td>
																		</tr>
																		<tr>
																				<td>&nbsp;</td>
																				<td><div align="right" class="style27">Site Oficial : </div></td>
																				<td>&nbsp;</td>
																				<td><?php echo $this->Form->input('Empresa.site_oficial',array('label'=>false,'div'=>false,'size'=>50));?> <br>( <span class="footer">por exemplo  http://www.infomoz.net</span> )</td>
																		</tr>
																		<tr>
																			<td>&nbsp;</td>
																			<td><div align="right" class="style27">Newsletter : </div></td>
																			<td>&nbsp;</td>
																			<td>
																				<table cellspacing="0" cellpadding="0" border="0" align="left">
																					<tbody><tr>
																						<td><input disabled="true" type="checkbox" id="checkbox_news" checked="" value="Yes" name="newsletter">&nbsp;<span class="small"><label class="label" for="checkbox_news">Inscrever-se</label></span></td>
																					</tr>
																				</tbody></table>
																			</td>
																		</tr>
																	</tbody></table>
																</td>
															</tr>
															<tr>
																<td>&nbsp;</td>
															</tr>
															<tr>
																<td class="style23"><br><b>Nota : </b>Ao clicar no botão seguinte, você confirma que concorda com os nossos <a target="terms" href="#"><b>Termos e Condições</b> </a>e a nossa  <a target="terms" href="privacy.php"><b>Política de Privacidade</b></a></td>
															</tr>
															<tr>
																<td>&nbsp;</td>
															</tr>
															<tr>
																<td><div align="center"><?php echo $this->Form->end(__('Registrar', true));?></div></td>
															</tr>
														</tbody></table>
													</td>
												</tr>
											</tbody></table>
										</td>
									</tr>
								</tbody></table>
							</td>
						</tr>
					</tbody></table>
					</div>

<script>
$j = jQuery.noConflict();
$j(document).ready( function() {
$j("#cargos").autocomplete({
// callback que irá buscar os dados baseado no valor do campo
source: function(req, add){
// faz a requisição e espera um json como resposta
$j.getJSON("/empregos/empresas/ajax_busca_cargos?callback=?", req, function(data) {
// array que guardará o resultado do getJSON
var busca = [];

// trata o retorno do getJSON
$j.each(data, function(i, val){
busca.push(val.name);
});

add(busca);
});
}
});
});
</script>

<?php
//echo $this->Javascript->link(array('jquery-ui/js/jquery-ui-1.8.5.custom.min'));
echo $this->Html->script('jquery-ui/js/jquery-ui-1.8.14.custom.min');
echo $this->Html->css('../js/jquery-ui/css/ui-lightness/jquery-ui-1.8.14.custom');
?>